package com.example.service;

import com.example.security.CurrentUserHolder;
import org.springframework.stereotype.Component;

/**
 * @author zihong.zheng
 * @version 1.0
 * @date 2018/4/18
 * @time 22:36
 * @description
 */
@Component
public class AuthService {

    public void checkAccess(){
        String user = CurrentUserHolder.get();
        if(!"admin".equals(user)){
            throw new RuntimeException("operate not allow");
        }
    }
}
